Ext.define('com.hh.goodsmanage.Goodsmanage.GoodsmanageList', {
			extend : 'com.hh.global.SimpleGridPanelWindow',
			action : 'goodsmanage-Goodsmanage-',
			editPage : 'com.hh.goodsmanage.Goodsmanage.GoodsmanageEdit',
			constructor : function(config) {
				this.config = config || {};
				this.toolbarItems = [{
							iconCls : 'view',
							text : "查看库存",
							scope : this,
							handler : this.doViewInventory
						}];
				this.superclass.constructor.call(this, this.config);
			},
			doViewInventory : function() {
				var record = this.grid.getSelectionModel().getLastSelected();
				var id = null;
				var name = "所有商品";
				if (!Util.isNull(record)) {
					id = record.get("id");
					name = record.get("name") + "(" + record.get("code") + ")";
				} else {
					ExtFrame.msg("请选中要查看的数据！");
					return;
				}
				var window = ExtUtil.open("com.hh.base.BaseServicePanel", {
							title : '查看库存',
							padding : '5',
							bodyStyle : "background-color:#ffffff;"
						});

				Request.request("goodsmanage-Goodsmanage-viewInventory", {
							id : id
						}, function(result) {
							var html = Util.getHtml(name, ["颜色", "码数", "进货数",
											"出货数", "存量", "进货总价", "出货总价", "盈利"],
									["color", "codeNum", "inNum", "outNum",
											"number", "inZongjia",
											"outZongjia", "zongjia"], result);
							window.panel.update(html);
						});

			},
			getSelectTbarItems : function() {
				return [{
							fieldLabel : '名称',
							name : 'name'
						}, {
							fieldLabel : '款号',
							name : 'code'
						}]
			},
			getGridColumns : function() {
				return [{
							text : '名称',
							dataIndex : 'name',
							flex : 1
						}, {
							text : '款号',
							dataIndex : 'code',
							flex : 1
						}, {
							text : '类别',
							dataIndex : 'type',
							flex : 1
						}, {
							text : '季度类别',
							dataIndex : 'jdType',
							flex : 1
						}, {
							text : '进价',
							dataIndex : 'inPrice',
							flex : 1
						}, {
							text : '出价',
							dataIndex : 'outPrice',
							flex : 1
						}, {
							dataIndex : 'id',
							flex : 1,
							hidden : true
						}, this.getOperateGridColumn()];
			},
			getStoreFields : function() {
				return ["id", "name", "code", "type", "jdType", "inPrice",
						"outPrice"];
			}
		});